import React from 'react';

const calcMoney = (price) => {
  let mixed = price % 100;
  const int = (price - mixed) / 100;
  mixed = (`0${mixed}`).slice(-2);
  // return [int, mixed];
	return int + '.' +mixed;
};
module.exports=[
  {
    key:'payAmount',
    title:'总额',
    dataType:'varTable',
    render: (text, row, index) => {
      if(!text)
      return;
        return <span>{calcMoney(text)}元</span>;
    }
  },
  {
    key:'baseAmt',
    title:'利息',
    dataType:'varTable',
    render: (text, record) => {
      return (
        <div>
          <span>{calcMoney(text)}元</span>
          <span style={{marginLeft: '20px'}}>{record.interestRate / 100}%</span>
        </div>
      );
    }
  },
  {
    key:'interestAmt',
    title:'手续费',
    dataType:'varTable',
    render: (text, record) => {
      return (
        <div>
          <span>{calcMoney(text)}元</span>
          <span style={{marginLeft: '20px'}}>{record.baseRate / 100}%</span>
        </div>
      );
    }
  },
  {
    key:'overdueManageFree',
    title:'逾期管理费',
    dataType:'varTable',
    render: (text, record) => {
      if (record.overdueDay === 0) {
        text = 0;
      }
      return <span>{text}元</span>
    }
  },
  {
    key:'overdueFree',
    title:'逾期罚息',
    dataType:'varTable',
    render: (text) => {
      return <span>{text}元</span>
    }
  },
]